#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Relationship.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Element;

/// <summary>
/// DirectedRelationship
/// A DirectedRelationship represents a relationship between a collection of source
/// model Elements and a collection of target model Elements.
/// </summary>
class UMLMODEL_EXPORT DirectedRelationship : public Relationship {

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// sources getter
    /// Specifies the source Element(s) of the DirectedRelationship.
    /// </summary>
    vector<shared_ptr<Element>>& sources();

    /// <summary>
    /// targets getter
    /// Specifies the target Element(s) of the DirectedRelationship.
    /// </summary>
    vector<shared_ptr<Element>>& targets();

private: // Fields
    /// <summary>
    /// sources
    /// Specifies the source Element(s) of the DirectedRelationship.
    /// </summary>
    vector<shared_ptr<Element>> sources_;

    /// <summary>
    /// targets
    /// Specifies the target Element(s) of the DirectedRelationship.
    /// </summary>
    vector<shared_ptr<Element>> targets_;

};

} // namespace uml
